#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	char ch = 0;
	while (scanf("%c", &ch) == 1)
	{
		if (ch <= 'z' && ch >= 'a')
		{
			ch = ch - 32;
		}
		else if(ch<='Z'&& ch>='A')
		{
			ch = ch + 32;
		}
		printf("%c", ch);
	}

	return 0;
}